#pragma once
#include <map>
#include <string>
namespace my_cpp_project
{
    class DiscreteSensor //: public Sensor
    {

    public:
        DiscreteSensor(int id, bool status);
        DiscreteSensor(DiscreteSensor &sensor);
        DiscreteSensor() {};

        bool get_status();
        void print_all_info();

        DiscreteSensor &operator=(const DiscreteSensor &input)
        {
            if (this != &input)
            { // 添加自赋值检查
                m_status = input.m_status;
                m_id = input.m_id; // 复制 ID
            }
            return *this;
        }

    private:
        bool m_status;
        int m_id;
    };
}
